home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Demos / AppMaker 2.0b3 / Demo AppMaker 1.5 / Demo AppMaker™ / Demo AppMaker™.rsrc / TmpP_403_DoMenuItem.Edit < prev    next >
Encoding:
Text File  |  1992-04-08  |  3.3 KB  |  136 lines

  1. %if MenuItemName = Cut%
  2.     {----------}
  3.     Procedure DoCut;
  4.     Begin
  5.         if cur^.text <> nil then begin
  6.             TECut (cur^.text);
  7.             cur^.dirty := true;
  8.             scrapDirty := true;
  9.         end;
  10.     End; {DoCut}
  11.  
  12. %elsif MenuItemName = Copy%
  13.     {----------}
  14.     Procedure DoCopy;
  15.     Begin
  16.         if cur^.text <> nil then begin
  17.             TECopy (cur^.text);
  18.             scrapDirty := true;
  19.         end;
  20.     End; {DoCopy}
  21.     
  22. %elsif MenuItemName = Paste%
  23.     {----------}
  24.     Procedure DoPaste;
  25.     Begin
  26.         if cur^.text <> nil then begin
  27.             TEPaste (cur^.text);
  28.             cur^.dirty := true;
  29.         end;
  30.     End; {DoPaste}
  31.  
  32. %elsif MenuItemName = Clear%
  33.     {----------}
  34.     Procedure DoClear;
  35.     Begin
  36.         if cur^.text <> nil then begin
  37.             TEDelete (cur^.text);
  38.             cur^.dirty := true;
  39.         end;
  40.     End; {DoClear}
  41.  
  42. %elsif MenuItemName = SelectAll%
  43.     {----------}
  44.     Procedure DoSelectAll;
  45.     Begin
  46.         if cur^.text <> nil then begin
  47.             TESetSelect (0, maxint, cur^.text);
  48.         end;
  49.     End; {DoSelectAll}
  50.  
  51. %elsif menuitemname = CreatePublisher%
  52.     {----------}
  53.     Procedure DoCreatePublisher;
  54.     var
  55.         theErr:            OSErr;
  56.         pdReply:        NewPublisherReply;
  57.     Begin
  58.     {$ifc false}
  59.     Uses Packages;
  60.         pdReply.usePart := false;
  61.         pdReply.preview := nil;                {should be handle to and}
  62.         pdReply.previewFormat := 'TEXT';    {type of preview data}
  63.     
  64.         { fill in pdReply.container: }
  65.         HLock (Handle (cur^.filename));
  66.         theErr := FSMakeFSSpec(cur^.volNum, 0 {dirID}, cur^.filename^,
  67.                                pdReply.container.theFile);
  68.                                     {should really pass default edition name}
  69.                                     {instead of cur^.filename}
  70.         HUnlock (Handle (cur^.filename));
  71.         if theErr = noErr then begin        { FSMakeFSSpec went ok }
  72.             pdReply.container.theFileScript := iuCurrentScript;
  73.                                                 { should be script code for cur^.filename }
  74.             pdReply.container.thePart := kPartsNotUsed;
  75.             pdReply.container.thePartName := '';        { not used }
  76.             pdReply.container.thePartScript := 0;        { not used }
  77.     
  78.             theErr := NewPublisherDialog (pdReply);
  79.             if (theErr = noErr) and notpdReply.canceled then begin
  80.                 { handle new publisher }
  81.             end { otherwise, NewPublisherDialog error or user cancelled }
  82.         end else begin
  83.             { handle FSMakeFSSpec error }
  84.         end
  85.     {$endc}
  86.     End; {DoCreatePublisher}
  87.  
  88. %elsif menuitemname = SubscribeTo%
  89.     {----------}
  90.     Procedure DoSubscribeTo;
  91.     var
  92.         theErr:            OSErr;
  93.         sdReply:        NewSubscriberReply;
  94.     Begin
  95.         sdReply.formatsMask := kTEXTformatMask;
  96.         theErr := GetLastEditionContainerUsed (sdReply.container);
  97.         theErr := NewSubscriberDialog (sdReply);
  98.         if not sdReply.canceled then begin
  99.             { handle subscriber to }
  100.         end;
  101.     End; {DoSubscribeTo}
  102.  
  103. %elsif menuitemname = SubscriberOptions%
  104.     {----------}
  105.     { This procedure displays either the publisher options or }
  106.     { subscriber options dialog, depending on what's selected. }
  107.     {----------}
  108.     Procedure DoSubscriberOptions;
  109.     var
  110.         theErr:            OSErr;
  111.         soReply:        SectionOptionsReply;
  112.     Begin
  113.         theErr := SectionOptionsDialog (soReply);
  114.         if (theErr = noErr) & (not soReply.canceled) then begin
  115.             if soReply.action = 'read' then begin    { "Get Edition Now" }
  116.  
  117.             end else if soReply.action = 'writ' then begin
  118.                                                     { "Send Edition Now" }
  119.  
  120.             end else if soReply.action = 'goto' then begin
  121.                                                     { "Open Publisher" }
  122.  
  123.             end else if soReply.action = 'cncl' then begin
  124.                                                     { "Cancel Publisher/Subscriber" }
  125.  
  126.             end else if soReply.action = '    ' then begin
  127.                                                     { "OK" }
  128.  
  129.             end;
  130.         end;
  131.     End; {DoSubscriberOptions}
  132.  
  133. %else%
  134.     %DoMenuItem%
  135. %end if%
  136.